import Vue from 'vue'
import Vuex from 'vuex'
import axios from 'axios'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    bowen: '',
    content: ''
  },
  getters: {
  },
  mutations: {
    bowen (state, value) {
      state.bowen = value.reverse()
      // console.log(state.bowen)
    }
  },
  actions: {
    async getBowen (store, value) {
      value = await axios.get('/boke/')
      // console.log(value)
      store.commit('bowen', value)
      return this.state.bowen
    }
  },
  modules: {
  }
})
